/*
 * Toedo
 * Copyright (C) 2009-2010 J. Devauchelle and contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 3 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package org.toedo.model.enums;

public enum SortDirection {

	EnAscending("0"), //$NON-NLS-1$
	EnDescending("1"); //$NON-NLS-1$
	
	protected String mValue;
	
	SortDirection(String value) {
		mValue = value;
	}
	
	public String getValue() {
		return this.mValue;
	}
	
	public static SortDirection getValueOf(String mode) {
		if (mode.equals("0")) { //$NON-NLS-1$
			return EnAscending;
		}
		if (mode.equals("1")) { //$NON-NLS-1$
			return EnDescending;
		}
		return EnAscending;
	}
	
}
